/**
 * 
 */
package dp.creat.factory;

/**
 * This is to describe factory design pattern. It gives us a way to instantiate
 * concrete implementations
 * 
 * @author Sunaina.Sharma
 * 
 */
public class ButtonFactory {

	public static void main(String[] args) {
		Button button = ButtonFactory.getButton("WINDOWS");
		Button button1 = ButtonFactory.getButton("LINUX");
		button.draw();
		button1.draw();
	}

	/**
	 * @return
	 */
	public static Button getButton(String type) {
		Button button;
		if (type.equals("WINDOWS")) {
			button = new WindowsButton();
		} else {
			button = new LinuxButton();
		}

		return button;
	}
}
